package com.refusea.commons.utils

import com.alibaba.fastjson2.JSON

/**
 * @author Zhang Yan
 * @date 2023-5-18
 **/
object Logs {

    @JvmStatic
    fun toJson(obj: Any?): JsonWrapper? {
        return if (obj == null) {
            null
        } else {
            JsonWrapper(obj)
        }
    }

    data class JsonWrapper(private val obj: Any) {
        override fun toString(): String {
            return JSON.toJSONString(obj)
        }
    }

}
